package com.ssy.lingxi.workflow.api.model.vo.response;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * 查询单一的外部流程、内部流程定义时的返回
 * @author 万宁
 * @version 2.0.0
 * @date 2021-04-28
 */
public class SimpleTaskVO implements Serializable {
    private static final long serialVersionUID = -2781808509202709740L;

    public SimpleTaskVO() {
        this.taskStep = 0;
        this.taskName = "";
        this.roleName = "";
        this.properties = new HashMap<>();
    }

    /**
     * 任务步骤
     */
    private Integer taskStep;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 可执行此步骤任务的角色名称
     * <p>当查询的是外部流程，此字段表示会员角色名称</p>
     * <p>当查询的是内部流程，此字段表示用户角色名称</p>
     */
    private String roleName;

    /**
     * 任务自定义属性
     */
    private Map<String, String> properties;

    public Integer getTaskStep() {
        return taskStep;
    }

    public void setTaskStep(Integer taskStep) {
        this.taskStep = taskStep;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Map<String, String> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, String> properties) {
        this.properties = properties;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SimpleTaskVO taskVO = (SimpleTaskVO) o;
        return taskStep.equals(taskVO.taskStep) &&
                Objects.equals(taskName, taskVO.taskName) &&
                Objects.equals(roleName, taskVO.roleName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(taskStep, taskName, roleName);
    }
}
